package com.cos.m3.web.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @author: COS
 * @time: 2022/6/9 9:10
 * @description:
 */
@RestController
@RequestMapping("/demo1")
public class DemoController {

    @RequestMapping("/d1")
    public String d1(Integer num){
        if (num==1) {
            System.out.println(10/0);
        }
        //获取数据
        return "ok";
    }
    @RequestMapping("/d2")
    public String d2(Integer num) throws FileNotFoundException {
        if (num==1) {
            FileInputStream fis=  new FileInputStream("");
        }
        //获取数据
        return "ok";
    }
    @RequestMapping(value = "/d3",method = RequestMethod.GET)
    public String d3(Integer num) {
        System.out.println(num.compareTo(1));
        //获取数据
        return "ok";
    }
    @RequestMapping(value = "/d3",method = RequestMethod.POST)
    public String d4(Integer num) {
        System.out.println(num.compareTo(1));
        //获取数据
        return "ok";
    }


}
